<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function myCallback(xhr){
        alert(xhr.responseText);
    }
    ajax.request("somefile.txt","get",myCallback);
    ajax.request("script.php","post",myCallback,"first=John&last=Smith");
</script>
</body>
</html>